package com.lingyuan.oms.config;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @ClassName：OrderHandler
 * @Author: LeiHao
 * @Date: 2024/9/12 17:49
 * @Description: order 表字段自动填充
 */
@Component
public class OrderHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("createTime", new Date(),metaObject);
        //TODO 后续换成当前登录人
        this.setFieldValByName("operateMan","雷浩",metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        this.setFieldValByName("modifyTime",new Date(),metaObject);
    }



}
